app.controller('pushMoney',["$rootScope","$scope","$state","userInfoCacheFactory","confirmFactory","userInfoService","pushMoneyService", function($rootScope,$scope,$state,userInfoCacheFactory,confirmFactory,userInfoService,pushMoneyService) {
    $scope.myorderlist = {};
    $scope.userInfoData={};
    $scope.discount={};
    //$scope.userInfoData = $rootScope.userInfoData;
    $scope.toWeixin = function(amount,discount){
        if($scope.userInfoData.level==0){
            $scope.discount=discount["lv0"];
        }else if($scope.userInfoData.level==1){
            $scope.discount=discount["lv1"];
        }else if($scope.userInfoData.level==2){
            $scope.discount=discount["lv2"];
        }
        $state.transitionTo("order/pay");
    };
    userInfoService.userInfo(function(data){
        $scope.userInfoData = data.data;
    });
    pushMoneyService.orderInfo(function(data){
         $scope.moneylist = data.data;
    })
}]);
